package com.data.modules.smzh.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.data.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description: 设备日志表
 * @Author: data-boot
 * @Date:   2023-01-05
 * @Version: V1.0
 */
@Data
@TableName("sm_device_logs")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="sm_device_logs对象", description="设备日志表")
public class SmDeviceLogs implements Serializable {
    private static final long serialVersionUID = 1L;

	/**主键*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;

	/**日志类型1：报警 2：日志 3：其他*/
	@Excel(name = "日志类型1：报警 2：日志 3：其他", width = 15, dicCode = "sm_log_type")
	@Dict(dicCode = "sm_log_type")
    @ApiModelProperty(value = "日志类型1：报警 2：日志 3：其他")
    private Integer logType;
	/**设备类型：1：门口机 2：室内机*/
	@Excel(name = "设备类型：1：门口机 2：室内机", width = 15, dicCode = "smzh_device_type")
	@Dict(dicCode = "smzh_device_type")
    @ApiModelProperty(value = "设备类型：1：门口机 2：室内机")
    private Integer deviceType;
	/**设备编号*/
	@Excel(name = "设备编号", width = 15)
    @ApiModelProperty(value = "设备编号")
    private String deviceId;
	/**Sip 号码*/
	@Excel(name = "Sip 号码", width = 15)
    @ApiModelProperty(value = "Sip 号码")
    private String sipNo;
	/**通道号*/
	@Excel(name = "通道号", width = 15)
    @ApiModelProperty(value = "通道号")
    private Integer channel;
	/**证件类型 1:身份证 */
	@Excel(name = "证件类型 1:身份证 ", width = 15, dicCode = "smzh_certified_type")
	@Dict(dicCode = "smzh_certified_type")
    @ApiModelProperty(value = "证件类型 1:身份证 ")
    private Integer certifiedType;
	/**证件号码*/
	@Excel(name = "证件号码", width = 15)
    @ApiModelProperty(value = "证件号码")
    private String certifiedNo;
	/**姓名*/
	@Excel(name = "姓名", width = 15)
    @ApiModelProperty(value = "姓名")
    private String name;
	/**电话*/
	@Excel(name = "电话", width = 15)
    @ApiModelProperty(value = "电话")
    private String phone;
	/**触发时间*/
	@Excel(name = "触发时间", width = 15)
    @ApiModelProperty(value = "触发时间")
    private String triggerTime;
	/**事件编码*/
	@Excel(name = "事件编码", width = 15, dicCode = "smzh_event_code")
	@Dict(dicCode = "smzh_event_code")
    @ApiModelProperty(value = "事件编码")
    private Integer eventCode;
	/**事件名称(别名)*/
	@Excel(name = "事件名称(别名)", width = 15)
    @ApiModelProperty(value = "事件名称(别名)")
    private String eventName;
	/**认证类型编码*/
	@Excel(name = "认证类型编码", width = 15)
    @ApiModelProperty(value = "认证类型编码")
    private String certifiedTypeCode;
	/**卡号*/
	@Excel(name = "卡号", width = 15)
    @ApiModelProperty(value = "卡号")
    private String cardId;
	/**被访人*/
	@Excel(name = "被访人", width = 15)
    @ApiModelProperty(value = "被访人")
    private String visit;
	/**房屋编码*/
	@Excel(name = "房屋编码", width = 15)
    @ApiModelProperty(value = "房屋编码")
    private String houseCode;
	/**楼层编号*/
	@Excel(name = "楼层编号", width = 15)
    @ApiModelProperty(value = "楼层编号")
    private Integer floorNo;
	/**比对相似度*/
	@Excel(name = "比对相似度", width = 15)
    @ApiModelProperty(value = "比对相似度")
    private Integer similarity;
    /**二进制图片*/
    @Excel(name = "二进制图片", width = 15)
    private transient java.lang.String picString;

    private byte[] pic;

    public byte[] getPic(){
        if(picString==null){
            return null;
        }
        try {
            return picString.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getPicString(){
        if(pic==null || pic.length==0){
            return "";
        }
        try {
            return new String(pic,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
    /**通行结果*/
    @Excel(name = "通行结果", width = 15, dicCode = "smzh_result")
    @Dict(dicCode = "smzh_result")
    @ApiModelProperty(value = "通行结果")
    private java.lang.Integer result;
	/**备注说明*/
	@Excel(name = "备注说明", width = 15)
    @ApiModelProperty(value = "备注说明")
    private String note;

    /**是否已处理 0：未处理1：已处理*/
    @Excel(name = "是否已处理 0：未处理1：已处理", width = 15)
    @ApiModelProperty(value = "是否已处理 0：未处理1：已处理")
    private java.lang.Integer status;


    @TableField(exist = false)
    private String beign;

    @TableField(exist = false)
    private String end;

    @TableField(exist = false)
    @ApiModelProperty(value = "楼栋编号")
    private String buildNo;

    @TableField(exist = false)
    @ApiModelProperty(value = "单元号")
    private String unitNo;

    @TableField(exist = false)
    @ApiModelProperty(value = "房间号")
    private String roomNo;

}
